#include "matrixfunctions.h"

void ccwspiralPrint(int x[][100], int row, int col)
{
	int i, j, t;
	for(t=0; t<(row/2) +1; t++){
		for(i=row-t-1; i>t; --i)
			cout<<x[i][col-t-1]<<" ";
		for(j=col-t-1; j>t; --j)
			cout<<x[t][j]<<" ";
		for(i=t; i<row-t-1; ++i)
			cout<<x[i][t]<<" ";
		for(j=t; j<col-t-1; ++j)
			cout<<x[row-t-1][j]<<" ";
	
	}
}


int main()
{
	int row, col, k;
	int mat[100][100];
	cout<<"Number of rows : ";
	cin>>row;
	cout<<"Number of columns : ";
	cin>>col;
	readmatrix(mat, row, col);
	printmatrix(mat, row, col);
	cout<<endl;
	ccwspiralPrint(mat, row, col);
	cout<<endl;
	
	
return 0;
}
